﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace MushroomPicker
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            App.Current.Host.Settings.EnableFrameRateCounter = false;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
            Sound.Initialization();
            
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded -= MainPage_Loaded;
            SoundSetting.Current.AddMusicSet(check_Music);
            SoundSetting.Current.AddSoundSet(check_Sound);

            Sound.PlayBackSound();

        }

        private void StartGame_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Sound.PlayClick();
            NavigationService.Navigate(new Uri("/Game.xaml", UriKind.Relative));
        }

        private void Help_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Sound.PlayClick();
            NavigationService.Navigate(new Uri("/Help.xaml", UriKind.Relative));
        }

        private void GameCenter_Click(object sender, RoutedEventArgs e)
        {
            //if (OpenXLive.XLiveGameManager.CurrentSession != null && OpenXLive.XLiveGameManager.CurrentSession.IsValid)
            //{
                this.NavigationService.Navigate(new Uri("/OpenXLive.Silverlight;component/Forms/LobbyPage.xaml", UriKind.Relative));
            //}
        }
    }
}